<template>
	<view class="home-template3">
		<view class="item" :style="bg1" @click="handleRouter(bgObj1)"></view>
		<view class="item" :style="bg2" @click="handleRouter(bgObj2)"></view>
	</view>
</template>
<script>
	import {realmName} from "@/http";
	export default{
		name:"HomeTemplate3",
		data(){
			return {
				bgObj1:{},
				bgObj2:{},
			}
		},
		computed:{
			bg1(){
				return `background: url(${realmName + this.bgObj1.logoPicAddress}) center/cover no-repeat;`
			},
			bg2(){
				return `background: url(${realmName + this.bgObj2.logoPicAddress}) center/cover no-repeat;`
			}
		},
		methods:{
			init(options){
				this.bgObj1 = options.filter(item=>{
					if(Number(item.configName) == 10) return item;
				})[0];
				this.bgObj2 = options.filter(item=>{
					if(Number(item.configName) == 11) return item;
				})[0];
			},
			handleRouter(options){
				uni.showToast({
					title: "内容敬请期待",
					icon: "none"
				});
				// if(options.uniappRoute){
				// 	uni.navigateTo({
				// 		url: options.uniappRoute
				// 	})
				// }
			}
		}
	}
</script>

<style lang="scss" scoped>
	.home-template3{
		height: 160rpx;
		display: flex;
		justify-content: space-between;
		.item{ //租车
			height: 100%;
			flex:1;
			box-sizing: border-box;
			padding: 24rpx;
			border-radius: 12rpx;
			overflow: hidden;
			&+.item{ //服化
				margin-left: 32rpx;
			}
		}
	}
</style>